package com.ruoyi.school.handler.wall;

import com.ruoyi.school.domain.PacProSkillCert;
import com.ruoyi.school.domain.vo.HonorWallTopThreeVo;
import com.ruoyi.school.service.PacProSkillCertService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@Component
@RequiredArgsConstructor
public class SkillCertWallStrategy implements WallStrategy {
    private final PacProSkillCertService pacProSkillCertService;

    @Override
    public void audit(AuditDetails details) {
        PacProSkillCert output = new PacProSkillCert();
        output.setId(details.getAuditRecordId());
        output.setAcAudit(details.getAcAudit());
        pacProSkillCertService.audit(output);
    }

    /**
     * 获取荣誉墙 前三
     *
     * @param wallTopThree
     */
    @Override
    public List<HonorWallTopThreeVo> getTopThree(WallTopThree wallTopThree) {
        return pacProSkillCertService.getTopThree(wallTopThree);
    }

    /**
     * 获取学生的 荣誉列表
     *
     * @param wallTopThree
     * @return
     */
    @Override
    public List<HonorWallTopThreeVo> getStuHonorList(WallTopThree wallTopThree) {
        return pacProSkillCertService.getStuHonorList(wallTopThree);
    }
}